<?php defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class DocarioViewListport extends JView {
    function display($tpl=null) {
        
        $doc =& JFactory::getDocument();
        $doc->addScript(ASSETS_JS . DS . 'ports.js');
        
        $model = $this->getModel();
        
        $cid = 0;
        if (JRequest::getVar('cid')) {
            $cid = JRequest::getVar('cid');
        }
        
        $model->setCatId($cid);
        $categories = $model->getCategories();
        $files = $model->getFiles();
        $category = $model->getCategory();
        
        // only with breadcrumb activated
        $breadcrumb = $model->getBreadCrumb();
        $this->assignRef('breadcrumb', $breadcrumb);
        
        $this->assignRef('cid', $cid);
        $this->assignRef('categories', $categories);
        $this->assignRef('files', $files);
        $this->assignRef('category', $category);
        
        // Itemid from Joomla menu system
        $this->assignRef('itemid', JRequest::getVar('Itemid'));
    
        parent::display($tpl);
    }
}
?>
